<!DOCTYPE html>
<html>
<head>
    <include file="admin/public/head"/>
</head>
<body>
<div id="app1">
    <el-row>
        <el-button @click="add_dialog()" type="success">添加文章</el-button>
    </el-row>
</div>
</body>
<script>
    new Vue({
        el: '#app1',
        data: function () {
            return {}
        },
        methods: {
            add_dialog: function () {
                this.openDialog("添加文章", "{:cmf_plugin_url('yongtai://article/add_article')}")
            },
            add_single: function () {
                this.openDialog("添加单页", "{:cmf_plugin_url('yongtai://single_page/add_single')}")
            },
            openDialog: function (title, url, area = ['800px', 'calc(80% - 60px)'], offset = ["center"]) {
                let self = this;
                layui.use(['layer'], function () {
                    self.layer = layui.layer;
                    self.layer.open({
                        type: 2,
                        maxmin: true,
                        title: title,
                        offset: offset,
                        area: area,
                        content: url,
                        cancel: function () {
                            window.location.reload();
                        }
                    });
                })
            }
        }
    })
</script>
<style>
    #app1 {
        padding: 20px;
        padding-bottom: 0;
    }
</style>
</html>

<include file="admin/public/table"
         table_config="table_config"
         url="{:cmf_plugin_url('yongtai://Article/GetListPage')}"
/>